//
//  CareTaker.m
//  备忘录模式
//
//  Created by flannery on 2018/12/19.
//  Copyright © 2018年 flannery. All rights reserved.
//

#import "CareTaker.h"
#import "Memento.h"
@interface CareTaker()
@property (nonatomic, strong) NSMutableArray *mementoList;
@end

@implementation CareTaker

-(NSMutableArray*)mementoList{
    if(!_mementoList) {
        _mementoList = [[NSMutableArray alloc]init];
    }
    return _mementoList;
}

-(void)add:(Memento*)state{
//    self.mementoList
    [self.mementoList addObject:state];
}
-(Memento*)get:(int)index{
    return [self.mementoList objectAtIndex:index];
}
@end
